//
//  ELifeXMLParser.m
//  ELife
//
//  Created by  刘奇男 on 11-5-23.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import "ELifeXMLParser.h"
#import "ModelBase.h"
#import "ReflectionUtil.h"


@implementation ELifeXMLParser

@synthesize currentString;

ModelBase *model;

- (void) initWithModelClassName:(NSString*) className
{
    
    //    // Without reflection
    //    Foo *foo = [[Foo alloc] init];
    //    [foo hello];
    //    // With reflection
    //    Class cls = NSClassFromString(@"Foo");
    //    id foo = [[cls alloc] init];
    //    SEL selector = NSSelectorFromString(@"hello");
    //    [foo performSelector:selector withObject:nil];
    
    model = [ReflectionUtil className];
//    SEL selector = NSSelectorFromString(@"hello");
//    [model performSelector:selector withObject:nil];
}

- (BOOL)parse:(NSData *)data
{
    return YES;
}

static NSString *kName_Msg = @"msg";
static NSString *kName_body = @"body";

- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *) qualifiedName attributes:(NSDictionary *)attributeDict 
{
}

- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName 
{
    if ([elementName isEqualToString:kName_Msg]) {
        
    } else if ([elementName isEqualToString:kName_body]) {
    }
}

@end
